<?php
/**
 * HTTPリクエストスタメン保存クラスユニットテストモジュール
 */
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/reporter.php';
require_once dirname(__FILE__) . '/../HttpRequestRegist.php';

/**
 * HTTPリクエストスタメン保存クラスユニットテストクラス
 */
class Components_StartingMember_UnitTest_HttpRequestRegistTest extends UnitTestCase
{
	/**
	 * ポジション取得メソッドテスト１
	 */
	public function Test1100()
	{
		$_REQUEST['POS1'] = 'BK';

		$objHttpRequestRegist = new Components_StartingMember_HttpRequestRegist();
		$RET = $objHttpRequestRegist->getPositionId(0);
		$this->assertEqual($RET, 'GK');
		$RET = $objHttpRequestRegist->getPositionId(1);
		$this->assertEqual($RET, 'BK');
	}

	/**
	 * 0行目ゴールキーパーの学年を取得
	 */
	public function Test1200()
	{
		$_REQUEST['P0'] = 'P0U7';
		$_REQUEST['P1'] = 'P1U8';

		$objHttpRequestRegist = new Components_StartingMember_HttpRequestRegist();
		$RET = $objHttpRequestRegist->getGakunenKey(0);
		$this->assertEqual($RET, 'P0U7');
		$RET = $objHttpRequestRegist->getGakunenKey(1);
		$this->assertEqual($RET, 'P1U8');
	}

	/**
	 * 0行目の選手ＩＤを取得
	 */
	public function Test1300()
	{
		$_REQUEST['P0U7'] = '1277792783.24';
		$_REQUEST['P1U8'] = '1277792812.45';

		$objHttpRequestRegist = new Components_StartingMember_HttpRequestRegist();
		$RET = $objHttpRequestRegist->getPlayerId(0);
		$this->assertEqual($RET, '1277792783.24');
		$RET = $objHttpRequestRegist->getPlayerId(1);
		$this->assertEqual($RET, '1277792812.45');
	}

	/**
	 * 0行目の選手氏名を取得
	 */
	public function Test1400()
	{
		$objHttpRequestRegist = new Components_StartingMember_HttpRequestRegist();
		$RET = $objHttpRequestRegist->getPlayerName(0);
		$this->assertEqual($RET, '山本音也');
		$RET = $objHttpRequestRegist->getPlayerName(1);
		$this->assertEqual($RET, '鈴木英治');
	}

	/**
	 * 0行目の学年ＩＤを取得
	 */
	public function Test1500()
	{
		$objHttpRequestRegist = new Components_StartingMember_HttpRequestRegist();
		$RET = $objHttpRequestRegist->getGakunenId(0);
		$this->assertEqual($RET, 'U7');
	}
}